<?php
include("../utility/connection.php");
include("../model/mSeminar.php");
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST") {
    $ubah = trim(mysql_real_escape_string($_POST["hidUbah"]));
    if ($ubah == '') {
        // hapus session2 yg gak diperlukan
        unset($_SESSION['ubah']);
        unset($_SESSION['ubahSeminar']);
        // simpan perubahan
        $Tema = trim(mysql_real_escape_string($_POST["txtTema"]));
        $DetilTema = trim(mysql_real_escape_string($_POST["txtUraian"]));
        $Tempat = trim(mysql_real_escape_string($_POST["txtTempat"]));
        $Tanggal = trim(mysql_real_escape_string($_POST["txtTanggal"]));
        $Waktu = trim(mysql_real_escape_string($_POST["txtWaktu"]));
        $TglAwalDaftar = trim(mysql_real_escape_string($_POST["txtTglAwalDaftar"]));
        $TglAkhirDaftar = trim(mysql_real_escape_string($_POST["txtTglAkhirDaftar"]));
        $Status = trim(mysql_real_escape_string($_POST["hidStsSeminar"]));
        fnInsertSeminar($Tema,$DetilTema,$Tempat,$Tanggal,$Waktu,$Status,$TglAwalDaftar,$TglAkhirDaftar);
        // masuk halaman admin seminar lagi
        unset($_SESSION['seminarResult']);
        unset($_SESSION['topikId']);
        header("location: ../ui/admin/seminarAdmin.php");
    }
}
?>
